import 'dart:convert';

class RemoteExecuteResult {

  RermoteExecutionStatus executionStatus;

  RemoteExecuteResult({this.executionStatus});

  bool isVaild() {
    return executionStatus.isVaild();
  }

  factory RemoteExecuteResult.fromJson(Map<String,dynamic> json){
    Map<String,dynamic> jsonDict = json["executionStatus"];
    if (jsonDict == null) { return null; }
    return RemoteExecuteResult(executionStatus: RermoteExecutionStatus.fromJson(jsonDict));
  }

  Map<String,dynamic> toJson({object: RemoteExecuteResult}){
     return {
       "executionStatus":  executionStatus.toJson()
     };
  }
}

class RermoteExecutionStatus {

  String eventId;

  String seviceType;

  String status;

  RermoteExecutionStatus({this.eventId, this.seviceType, this.status});

  bool isVaild() {
    return this.eventId != null && this.seviceType != null && this.status != null;
  }

  factory RermoteExecutionStatus.fromJson(Map<String,dynamic> json){
     String eventId = json["eventId"];
     String serviceType = json["serviceType"];
     String status = json["status"];
    return RermoteExecutionStatus(eventId: eventId, seviceType: serviceType, status: status);
  }

  Map<String,dynamic> toJson(){
    return {
      "eventId": eventId,
      "serviceType": seviceType,
      "status": status
    };
  }
}